﻿using NCS.IConnect.Core.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace NCS.IConnect.Core.WebApi.Description
{
    /// <summary>
    /// A custom <see cref="HeaderAttribute"/> for response only.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
    public class ResponseHeaderAttribute : HeaderAttribute
    {
        /// <summary>
        /// Gets the condition code.
        /// </summary>
        /// <value>The condition code.</value>
        public string ConditionCode { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="ResponseHeaderAttribute"/> class.
        /// </summary>
        /// <param name="conditionCode">The condition.</param>
        /// <param name="headerName">Name of the header.</param>
        /// <param name="description">The description.</param>
        /// <param name="remark">The remark.</param>
        public ResponseHeaderAttribute(string conditionCode, string headerName, string description, string remark = null) : base(headerName, description, remark)
        {
            Guard.ArgumentNotNullOrEmpty("condition", "condition");
            this.ConditionCode = conditionCode;
        }
    }
}